class Solution {
    public boolean detectCapitalUse(String word) {
        int n=word.length();
        int daxie=0;
        int one=word.charAt(0);
        for(int i=0;i<n;i++)
        {
            char a=word.charAt(i);
            if(a>=65&&a<=90)
            daxie++;
        }
        if(daxie==n||daxie==0||((one>=65&&one<=90)&&daxie==1))
        return true;
        else
        return false;
    }
}
